<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../css/reset.css">
    <style>
        .title {
            line-height: 40px;
        }

        .list {
            margin-top: 20px;
        }

        .list li {
            line-height: 32px;
            border: 1px dashed #333;
        }
    </style>
</head>

<body>
    <div id="wrap">
        <h2 class="title">标题</h2>
        <ul class="list one">
            <li class="first" id="demo">01</li>
            <li>02</li>
            <li class="mid">03</li>
            <li>04</li>
            <li>05</li>
            <li class="last">06</li>
        </ul>
        <ul class="list two">
            <li>07</li>
            <li>08</li>
            <li>09</li>
            <li>10</li>
            <li>11</li>
            <li>12</li>
        </ul>
    </div>
</body>
<script>
    // 元素节点的查找

    // one里面的li(6)
    var one = document.getElementsByClassName("one")[0];
    var liList = one.getElementsByTagName("li");
    console.log(liList);


    // 通过选择器查找 (要求传入一个css选择器(字符串)=>返回对应的元素)
    // document.querySelector(selector)      单元素获取(如果有多个 -> 默认选中集合中的第一个)  => 有就返回元素,没有就返回null 
    // document.querySelectorAll(selector)   多元素获取 将获取的元素存到集合中,即便id也是如此 => 有就返回元素的集合 ,没有就返回 []

    // var wrap = document.querySelector("#wrap");
    // console.log(wrap);
    // var title = document.querySelector(".title");
    // console.log(title);
    // var list = document.querySelector(".list");
    // console.log(list);
    // var li = document.querySelector(".list li");
    // console.log(li);


    var wrap = document.querySelectorAll("#wrap");
    console.log(wrap);
    var title = document.querySelectorAll(".title");
    console.log(title);
    var list = document.querySelectorAll(".list");
    console.log(list);
    var li = document.querySelectorAll(".one li");
    console.log(li);







</script>

</html>